package com.itheima.d5_Api_Objects;

import java.util.Objects;

/**
 * objects的equals,isNull方法
 */
public class Test {
    public static void main(String[] args) {
        String s1 =null;
        String s2 = "11454";
       // System.out.println(s1.equals(s2));//会报空指针异常
        System.out.println(Objects.equals(s1,s2));//更加安全
        System.out.println(Objects.isNull(s1));
    }
}
